package pl.poznan.put.cs.idss.particlefilter.enviroment;

public class Island {

	private int x;
	private int y;
	private int radius;

	public Island(int x, int y, int r) {
		this.setX(x);
		this.setY(y);
		this.setRadius(r);
	}

	public boolean isOnIsland(int a, int b, int tolerance) {
		if (Math.sqrt((a - getX()) * (a - getX()) + (b - getY()) * (b - getY())) <= getRadius()
				- tolerance) {
			System.out.println("WYSPA: " + a + " " + b);
			return true;
		}
		return false;
	}

	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

	public int getRadius() {
		return radius;
	}

	public void setRadius(int radius) {
		this.radius = radius;
	}

}
